package Tree;

import java.util.Scanner;

/**
 * Created by Administrator on 2017/10/25/025.
 */
public class Twentyquestion {
    private LinkedBinaryTree<String>tree;
    public Twentyquestion(){
         String e1 = "你喜欢篮球这项运动吗？";
         String e2 = "那你平时有关注过关于篮球的新闻吗？";
         String e3 = "那你关注NBA吗？";
         String e4 = "对于篮球明星你的了解多吗？";
         String e5 = "那你知道历史上一些著名的球星吗？";
         String e6 = "那你听说过有关湖人队的新闻吗？";
         String e7 = "你知道洛杉矶湖人队吗？";
         String e8 = "好的，你可能真不知道。";
         String e9 = "去年有一个我们都很崇拜的明星退役了你知道他是谁吗？";
         String e10 = "你有没有听人说过去年有个篮球明星退役了？";
         String e11 = "那你应该猜到他是谁了，谢谢！";
         String e12 = "那你应该猜到他是谁了，谢谢！";
         String e13 = "那你应该知道他是谁了，谢谢！";
         String e14 = "那你应该猜到他是谁了，谢谢！";
         String e15 = "好的，你会知道我说的是谁了，谢谢！";
         String e16 = "那你应该猜到他是谁了，谢谢！";
         String e17 = "那你应该猜到他是谁了，谢谢！";
         String e18 = "好的，你可能真不知道。";
         String e19 = "那你应该猜到他是谁了，谢谢！";
         LinkedBinaryTree<String>n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16,n17,n18,n19;
        n16 = new LinkedBinaryTree<String>(e16);
        n17 = new LinkedBinaryTree<String>(e17);
        n9 = new LinkedBinaryTree<String>(e9,n16,n17);
        n18 = new LinkedBinaryTree<String>(e18);
        n19 = new LinkedBinaryTree<String>(e19);
        n10 = new LinkedBinaryTree<String>(e10,n18,n19);
        n8 = new LinkedBinaryTree<String>(e8);
        n4 = new LinkedBinaryTree<String>(e4,n8,n9);
        n11 = new LinkedBinaryTree<String>(e11);
        n5 = new LinkedBinaryTree<String>(e5,n10,n11);
        n12 = new LinkedBinaryTree<String>(e12);
        n13 = new LinkedBinaryTree<String>(e13);
        n6 = new LinkedBinaryTree<String>(e5,n12,n13);
        n14 = new LinkedBinaryTree<String>(e14);
        n15 = new LinkedBinaryTree<String>(e15);
        n7 = new LinkedBinaryTree<String>(e6,n14,n15);
        n2 = new LinkedBinaryTree<String>(e2,n4,n5);
        n3 = new LinkedBinaryTree<String>(e3,n6,n7);
        tree = new LinkedBinaryTree<String>(e1,n2,n3);
    }
    public void diagose() throws Exception {
        Scanner scan = new Scanner(System.in);
        LinkedBinaryTree<String>current = tree;
        System.out.println("他的名字叫科比.布莱恩特");
        while (current.size() > 1)
        {
            System.out.println (current.getRootElement());
            if (scan.nextLine().equalsIgnoreCase("N"))
                current = current.getLeft();
            else
                current = current.getRight();
        }

        System.out.println (current.getRootElement());
    }
}